{strip}
{literal}
<style type="text/css">
	label.error { float: right; color: red; padding-left: .5em; vertical-align: top; }
	p { margin-bottom: 10px;clear: both; }
	em { font-weight: bold; padding-right: 1em; vertical-align: top; }
</style>

<script>
jQuery.validator.setDefaults({
	debug: true,
	success: "valid"
});

$(document).ready(function() {
	//$('#users_add_form').validate();
	var options = { 
        beforeSubmit:  showRequest,  // pre-submit callback 
        success:       showResponse  // post-submit callback 
    }; 
 
   $("#loginForm").validate({
   		onkeyup: false,
		
    	submitHandler: function(form) {
   			$(form).ajaxSubmit(options);
   		}

	});
    
    
});

// pre-submit callback 
function showRequest(formData, jqForm, options) { 
    var queryString = $.param(formData); 
    //return checkForm(); 
} 
 
// post-submit callback 
function showResponse(responseText, statusText)  { 
	scroll(0,0);
	//showPopup2(responseText, 'Login form', false);
	var obj = jQuery.parseJSON(responseText);
	if (obj.redirect == 1)
		window.location.reload();
    else {
    	alert('Login failed');
        //showPopup(obj.body, 'Login form', false);
	}
}

function checkForm(){

}
</script>

<style>

#loginBox {
	padding: 10px;
	background-color: #EEEEEE;
	-moz-border-radius-topleft: 8px;
    -moz-border-radius-topright: 8px;
}

#loginBox input{
	width: 80%;
	height: 40px;
	background-color:#F5F5E5;
	color: #4F535E;
	font-size: 16pt;
}

#loginBox h1{
	font-size: 24pt;
	font-weight: bold;
	padding: 0px;
	margin: 0px;
}

#loginBox h2{
	font-size: 18pt;
	font-weight: normal;
	padding: 0px;
	margin: 0px;
}

#loginBox .submit{
	width: 120px;
	background-color: #FAFAFA;
	border-bottom: 2px solid #B6B6B6;
	border-right: 2px solid #B6B6B6;
	border-left: 1px solid #B6B6B6;
	border-top: 1px solid #B6B6B6;
	cursor: pointer;
}
</style>

{/literal}

<!-- content -->
            <div id="content">
            	
                <div id="content_left">
                <div id="loginBox">
                	<h1>State thy name and ye shall pass</h1>
                	<h2>Not a member yet? <a href="/register">Register now</a> — it's fun and easy!</h2>
                	<br />
                	<form id="loginForm" method="POST" action="/login/process" onsubmit="">
					<p>
						<label for="f3"><b>Username</b></label><em>*</em><br />
						<input id="username" type="text" name="username" value="" class="required" minlength="3" onfocus="$('#username').css('backgroundColor', '#FFFFAA');" onblur="$('#username').css('backgroundColor', '#F5F5E5');"/>
					</p>
					
					<p>
						<label for="password"><b>Password</b></label><em>*</em><br />
						<input id="password" type="password" name="password" value="" class="required"  onfocus="$('#password').css('backgroundColor', '#FFFFAA');" onblur="$('#password').css('backgroundColor', '#F5F5E5');"/>
					</p>
					<div class="v_spacer"> </div>
					<div>

						<div class="right">
							<input type="submit" value="Login" class="submit" id="sub1" onmouseover="$('#sub1').css('color', '#d0d0d0');" onmouseout="$('#sub1').css('color', '#515151');"/>
						</div>
					</div>
					<div class="clear"></div>
					</form>
                </div>
				</div>
                
                <div id="content_right">
                	
                	{include file='block_categories.tpl'}
                    <br />
                    {include file='block_requests.tpl'}
                    <br />
                </div>
            	<div class="clear"></div>
            </div>
            <!-- end content  -->

{/strip}


